Current cancellation techniques may be utilized to cancel current at one or more nodes of a circuit. For example, current cancellation techniques may be utilized to cancel leakage current that degrades signals in a current sensor device. In a specific example, current cancellation techniques may be utilized in optical sensors. Optical sensors that employ photo sensor diodes are used in electronic devices to detect ambient light conditions. However, the resolution of such optical sensors can be limited by leakage current, most notably dark current produced by the photo sensor diodes. Dark current is the current that is generated by photo sensor diodes when the photo sensor diodes are exposed to total darkness (i.e., are exposed to no light). The amount of dark current generated by photo sensor diodes varies with process variations of the diode, the area of the diode, the temperature of the diode, the junction depth of the diode, and so forth. However, the amount of dark current generated in typical optical sensors may range from one (1) pico Ampere (pA) to one hundred (100) pA at room temperature.
As illustrated in FIG. 1, current IPD1 may be mirrored to subtract, or cancel, the unwanted portion of current (e.g., dark current in current IPD2) at the second node. For instance, if transistors M1 and M2 are accurately matched, transistor M1 mirrors the exact value of current IPD1 to transistor M2, which cancels current IPD2 at the second node (e.g., current at the second node is defined by the equation [IPD2−IPD1]). However, due to the mismatching of transistors M1 and M2, current IPD1 may not be accurately mirrored to transistor M2, which does not allow for an accurate subtraction to occur at the second node.